<!DOCTYPE html>
<html>
<head>
    <title>物料表</title>
    <#include "/header.html">
        </head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.itemCode" @keyup.enter="query" placeholder="物料编号">
            </div>
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.itemName" @keyup.enter="query" placeholder="物料名称">
            </div>
            <a class="btn btn-default" @click="query">查询</a>
            <#if shiro.hasPermission("sys:tblmtlitem:save")>
                <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            </#if>
            <#if shiro.hasPermission("sys:tblmtlitem:update")>
                <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            </#if>
            <#if shiro.hasPermission("sys:tblmtlitem:delete")>
                <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            </#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">物料代码</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.itemCode" placeholder="物料代码"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">物料名称</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.itemName" placeholder="物料名称" id="itemName"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">物料规格</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.itemSpecification" placeholder="物料规格"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">单位</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.unit" placeholder="单位"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">启用FLAG</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.enableFlag" placeholder="启用FLAG"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">物料分类</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.itemGroup" placeholder="物料分类"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">价格</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.price" placeholder="价格"/>
                </div>
            </div>
            <div class="form-group" style="display:none">
                <div class="col-sm-2 control-label">物料图片路径</div>
                <div class="col-sm-10">
                    <input id="picPath" type="text" class="form-control" v-model="tblMtlItem.picPath" placeholder="物料图片路径"/>
                </div>
            </div>
            <div class="form-group" style="display: none">
                <div class="col-sm-2 control-label">公司ID</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.companyId" placeholder="公司ID"/>
                </div>
            </div>
            <div class="form-group" style="display:none">
                <div class="col-sm-2 control-label">备注</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.attribute1" placeholder="备注"/>
                </div>
            </div>
            <div class="form-group" style="display:none">
                <div class="col-sm-2 control-label">备注</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.attribute2" placeholder="备注"/>
                </div>
            </div>
            <div class="form-group" style="display:none">
                <div class="col-sm-2 control-label">备注</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.attribute3" placeholder="备注"/>
                </div>
            </div>
            <div class="form-group" style="display:none">
                <div class="col-sm-2 control-label">备注</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.attribute4" placeholder="备注"/>
                </div>
            </div>
            <div class="form-group" style="display:none">
                <div class="col-sm-2 control-label">备注</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.attribute5" placeholder="备注"/>
                </div>
            </div>
            <div class="form-group" style="display:none">
                <div class="col-sm-2 control-label"></div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.createTime" placeholder=""/>
                </div>
            </div>
            <div class="form-group" style="display:none">
                <div class="col-sm-2 control-label"></div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.createBy" placeholder=""/>
                </div>
            </div>
            <div class="form-group" style="display:none">
                <div class="col-sm-2 control-label"></div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.updateTime" placeholder=""/>
                </div>
            </div>
            <div class="form-group" style="display:none">
                <div class="col-sm-2 control-label"></div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="tblMtlItem.updateBy" placeholder=""/>
                </div>
            </div>
            <div class="control-group">
                <label for="requirement" class="col-md-3 control-label span3">图片上传</label>
                <div class="col-md-9">
                    <div class="input-group">
                        <input id="photoCover" class="form-control" readonly type="text">
                        <label class="input-group-btn">
                            <input id="file" type="file" name="file" style="left: -9999px; position: absolute;">
                            <span class="btn btn-default">Browse</span>
                        </label>
                    </div>
                </div>

                <img  id="uploadImg" src="" style="width: 300px;height: 300px;margin-top:-470px;margin-left:508px"/>
                <label class="col-md-2 control-label span2"></label>
                <div class="col-md-10" style="margin-left:540px;margin-top:-74px">
                    <a class="btn btn-small btn-danger" onclick="saveUser2()">上传</a>
                </div>
            </div>
            <div class="control-group">

            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>

        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/sys/tblmtlitem.js?_${.now?long}"></script>
</body>
</html>